package com.cx.dbtablelist.util;

/**
 * 表达式帮助类
 * @date : 2014-2-14
 * @author caoxu-yiyang@qq.com
 */
public abstract class ExpressionUtils {
	public static String REGEX_REXPRESS = "\\$\\{.*?\\}";
	
	public static boolean isExpression(String value){
		if(value != null){
			return value.startsWith("${") && value.endsWith("}");
		}
		return false;
	}
	
	public static String getExpressionValue(String value){
		return value.substring(2, value.length()-1);
	}
	
	public static String tryGetExpressionValue(String value){
		if(isExpression(value)){
			return getExpressionValue(value);
		}
		return value;
	}
}
